package com.vogue.supplymall.shop.domain.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.vogue.ssm.database.dao.BaseDao;
import com.vogue.supplymall.shop.domain.dao.ProductPriceDao;
import com.vogue.supplymall.shop.domain.model.ProductPrice;
import com.vogue.supplymall.shop.domain.service.ProductPriceService;
/**
 * The type ProductPrice service.
 *
 * @aouthor: gzl
 * @create: 2017 -12-01
 */
@Service("productPriceService")
public class ProductPriceServiceImp extends BaseServiceImpl<ProductPrice, Long> implements ProductPriceService {

	@Resource
	private ProductPriceDao productPriceDao;
	
	public ProductPriceServiceImp(BaseDao<ProductPrice, Long> baseDao) {
		super(baseDao);
		// TODO Auto-generated constructor stub
	}

	@Override
	public ProductPrice findProductPriceBySPAO(Long syscodeId, Long productId, Long attrplanId, Long oneId) {
		ProductPrice pp=new ProductPrice();
		
		List<ProductPrice> list=productPriceDao.findProductPriceBySPAO(syscodeId, productId, attrplanId, oneId);
		if(list.size()>0&&list.get(0)!=null) {
			pp=list.get(0);
		}
		
		return pp;
	}

	@Override
	public void delProductPriceBySPAO(Long syscodeId, Long productId, Long attrplanId, Long oneId) {
		productPriceDao.delProductPriceBySPAO(syscodeId, productId, attrplanId, oneId);
	}
	
}
